// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({ env:'cloud1-6gsv4k6hcacb77b6' })

// 云函数入口函数
exports.main = async (event, context) => {
  const db = cloud.database()
  try {
    const res = await db.collection('video').get()
    return {
      code: 0,
      data: res.data
    }
  } catch (err) {
    return {
      code: -1,
      message: err.message
    }
  }
}
